package rak.r91.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.SessionAttributes;
import org.springframework.web.servlet.ModelAndView;


@Controller
@SessionAttributes("user")
public class LogoutController {
    
	@RequestMapping("/logout")
    public ModelAndView logout(HttpServletRequest request, HttpServletResponse response){
    	request.getSession().removeAttribute("User");
    	request.getSession().invalidate();
    	return new ModelAndView("login");
    }
}
